package com.guli.order.feign;

import com.guli.common.to.StockWareTo;
import com.guli.common.utils.R;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;
import java.util.Map;

/*
 * @Author 罗俊
 * @date 2020/11/18 - 5:45 下午
 *
 */
@FeignClient(name = "ware-service")
public interface WareFeignClient {

    @ApiOperation("根据skuId，来批量查询库存，skuId对应的库存存放在Map的value位置")
    @PostMapping("/wms/waresku/getStockBySkuIdArray")
    public Map<Long,Integer> getStockBySkuIdArray(@RequestBody List<Long> skuIds);


    @ApiOperation("用户下单时，锁定库存")
    @PostMapping("/wms/waresku/lockWareStock")
    public R lockWareStock(@RequestBody StockWareTo stockWareTo);
}
